#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>
using namespace std;
int n, w;
const int N = 20;
int c[N];
int s[N];
int ret = N;
int cnt;
void dfs(int pos)
{
    if (cnt >= ret)
    {
        return;
    }
    if (pos > n)
    {
        ret = cnt;
        return;
    }
    for (int i = 1; i <= cnt; i++)
    {
        if (s[i] + c[pos] > w)
        {
            continue;
        }
        s[i] += c[pos];
        dfs(pos + 1);
        s[i] -= c[pos];
    }
    cnt++;
    s[cnt] = c[pos];
    dfs(pos + 1);
    s[cnt] = 0;
    cnt--;
}
bool cmp(int s1, int s2)
{
    return s1 > s2;
}
int main()
{
    cin >> n >> w;
    for (int i = 1; i <= n; i++)
    {
        cin >> c[i];
    }
    sort(c + 1, c + 1 + n, cmp);
    dfs(1);
    cout << ret << endl;
    return 0;
}